<include file="public@header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:url('order/index')}">订单列表</a></li>
		</ul>
        <form class="well form-inline margin-top-20" method="get" action="{:url('order/index')}">
        	供应商：
        	<select name='supplier_id' class="form-control">
        		<option value="">请选择供应商</option>
        		<foreach name="supplier_list" item="vo">
        			<option value="{$vo.id}" <if condition="$supplier_id eq $vo.id">selected</if>>{$vo.name}</option>
        		</foreach>
        	</select>
        	&nbsp;&nbsp;&nbsp;&nbsp;用户ID：
            <input type="text" class="form-control" name="member_id" style="width: 120px;" value="{$member_id}" placeholder="请输入用户ID">


            &nbsp;&nbsp;&nbsp;&nbsp;课程ID：
            <input type="text" class="form-control" name="course_id" style="width: 120px;" value="{$course_id}" placeholder="请输入课程ID">

            &nbsp;&nbsp;&nbsp;&nbsp;订单编号：
            <input type="text" class="form-control" name="order_number" style="width: 120px;" value="{$order_number}" placeholder="请输入订单编号">

            &nbsp;&nbsp;&nbsp;&nbsp;订单状态：
        	<select name='status' class="form-control">
        		<option value="">请选择订单状态</option>
        		<option value="1" <if condition="$status eq 1">selected</if>>待发货</option>
        		<option value="2" <if condition="$status eq 2">selected</if>>待收货</option>
        		<option value="3" <if condition="$status eq 3">selected</if>>退款中</option>
        		<option value="4" <if condition="$status eq 4">selected</if>>已完成</option>
        		<option value="5" <if condition="$status eq 5">selected</if>>已退款</option>
        	</select>

            &nbsp;&nbsp;&nbsp;&nbsp;是否有实物：
            <select name='if_entity' class="form-control">
            	<option value="">全部</option>
            	<option value="1" <if condition="$if_entity eq 1">selected</if>>否</option>
            	<option value="2" <if condition="$if_entity eq 2">selected</if>>是</option>
            </select>
            &nbsp;&nbsp;&nbsp;&nbsp;
            <input type="submit" class="btn btn-primary" value="搜索" />
        </form>

		<table class="table table-hover table-bordered">
			<thead>
				<tr>
					<th width="40">订单编号</th>
					<th>供应商</th>
					<th>课程ID</th>
					<th>短标题</th>
					<th>上课方式</th>
					<th>是否有实物</th>
					<th>用户ID</th>
					<th>收货人</th>
					<th>手机号码</th>
					<th>收货地址</th>
					<th>快递信息</th>
					<th>付款金额</th>
					<th>付款时间</th>
					<th>订单状态</th>
					<th width="140">操作</th>
				</tr>
			</thead>
			<tbody>
				<foreach name="list" item="vo">
				<tr>
					<td>{$vo.order_number}</td>

					<td>
			    		<foreach name="supplier_list" item="so">
			    			<if condition="$vo.supplier_id eq $so.id">{$so.name}</if>
			    		</foreach> 
		    		</td>
					<td>{$vo.course_id}</td>
					<td>{$vo.title}</td>

					<td>
						<if condition="$vo.attend_type eq 1">
							<span class="label label-success">手机</span>
						<elseif condition="$vo.attend_type eq 2" />
							<span class="label label-success">兑换码</span>
						<elseif condition="$vo.attend_type eq 3" />
							<span class="label label-success">快递</span>
						</if>
					</td>
					<td>
						<if condition="$vo.if_entity eq 1">
							<span class="label label-success">否</span>
						<else />
							<span class="label label-danger">是</span>
						</if>
					</td>

					<td>{$vo.member_id}</td>
					<td>{$vo.recipients}</td>
					<td>{$vo.mobile}</td>
					<td>{$vo.site}</td>
					<td><notempty name="$vo.courier_name">{$vo.courier_name}<br>{$vo.express_number}</notempty></td>
					<td>{$vo.pay_money}</td>
					<td>{$vo.pay_time}</td>
					<td>
						<if condition="$vo.status eq 1">
							<span class="label label-success">待发货</span>
						<elseif condition="$vo.status eq 2" />
							<span class="label label-success">待收货</span>
						<elseif condition="$vo.status eq 3" />
							<span class="label label-danger">申请退款</span>
						<elseif condition="$vo.status eq 4" />
							<span class="label label-success">已完成</span>
						<elseif condition="$vo.status eq 5" />
							<span class="label label-success">已退款</span>
						<else />
							<span class="label label-danger">未付款</span>
						</if>
					</td>

					<td>
						<a href="{:url('order/particulars', ['order_id' => $vo.order_id])}">订单详情</a>&nbsp;&nbsp;&nbsp;

						<if condition="$vo.attend_type eq 1 AND $vo.status eq 1">
							<a href="{:url('order/mobileSend', ['order_id' => $vo.order_id])}" onClick="return confirm('确定发货?');">手机号发货</a>

						<elseif condition="$vo.attend_type eq 3 AND $vo.status eq 1">
							<a href="{:url('order/getCourierAll', ['order_id' => $vo.order_id])}" >手动发货</a>			
						</if>

						<a href="{:url('order/getCourierAll', ['order_id' => $vo.order_id])}" >物流信息</a>
						
					</td>
				</tr>
				</foreach>
			</tbody>
		</table>
		<div class="pagination">{$page}</div>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>